CUR_DIR := $(STANDALONE_DIR)

SRC_DIR += $(CUR_DIR)/common \
			$(CUR_DIR)/arch/common
INC_DIR += $(CUR_DIR)/common \
			$(CUR_DIR)/arch/common

ifndef CONFIG_USE_CACHE
	EXCL_SRC += $(CUR_DIR)/common/cache.c
endif

ifndef CONFIG_USE_MMU
	EXCL_SRC += $(CUR_DIR)/common/mmu.c
endif

##########################arch####################################
ifdef CONFIG_TARGET_ARMV8_AARCH64
	SRC_DIR += $(CUR_DIR)/arch/armv8/aarch64 \
				$(CUR_DIR)/arch/armv8/aarch64/gcc
	INC_DIR += $(CUR_DIR)/arch/armv8/aarch64/gcc \
				$(CUR_DIR)/arch/armv8/aarch64
endif #CONFIG_TARGET_ARMV8_AARCH64

ifdef CONFIG_TARGET_ARMV8_AARCH32
	SRC_DIR += $(CUR_DIR)/arch/armv8/aarch32 \
				$(CUR_DIR)/arch/armv8/aarch32/gcc
	INC_DIR += $(CUR_DIR)/arch/armv8/aarch32/gcc \
				$(CUR_DIR)/arch/armv8/aarch32
endif #CONFIG_TARGET_ARMV8_AARCH32

ifdef CONFIG_TARGET_ARMV7
	SRC_DIR += $(CUR_DIR)/arch/armv7/gcc
endif #CONFIG_TARGET_ARMV7

##########################board####################################
SRC_DIR += $(CUR_DIR)/board/common
INC_DIR += $(CUR_DIR)/board/common

ifdef CONFIG_TARGET_F2000_4
	SRC_DIR += $(CUR_DIR)/board/ft2004
	INC_DIR += $(CUR_DIR)/board/ft2004
endif

ifdef CONFIG_TARGET_E2000
	SRC_DIR += $(CUR_DIR)/board/e2000
	INC_DIR += $(CUR_DIR)/board/e2000
endif

ifdef CONFIG_TARGET_D2000
	SRC_DIR += $(CUR_DIR)/board/d2000
	INC_DIR += $(CUR_DIR)/board/d2000
endif

##########################drivers####################################
# gic
ifdef CONFIG_EBABLE_GICV3
	ifdef CONFIG_TARGET_ARMV8_AARCH64
		SRC_DIR += $(CUR_DIR)/drivers/gic/gicv3_arrch64
		INC_DIR += $(CUR_DIR)/drivers/gic/gicv3_arrch64
	endif 

	ifdef CONFIG_TARGET_ARMV8_AARCH32
		SRC_DIR += $(CUR_DIR)/drivers/gic/gicv3_arrch32
		INC_DIR += $(CUR_DIR)/drivers/gic/gicv3_arrch32
	endif #CONFIG_TARGET_ARMV8_AARCH32
endif

# timer
ifdef CONFIG_ENABLE_TIMER_TACHO
	SRC_DIR += $(CUR_DIR)/drivers/timer/hw_timer_tacho
	INC_DIR += $(CUR_DIR)/drivers/timer/hw_timer_tacho
endif

# qspi
ifdef CONFIG_USE_NOR_QSPI
	SRC_DIR += $(CUR_DIR)/drivers/qspi/nor_qspi
	INC_DIR += $(CUR_DIR)/drivers/qspi/nor_qspi
endif #CONFIG_USE_QSPI

# usart
ifdef CONFIG_ENABLE_Pl011_UART
	SRC_DIR += $(CUR_DIR)/drivers/usart/pl011_uart
	INC_DIR += $(CUR_DIR)/drivers/usart/pl011_uart
endif #CONFIG_ENABLE_Pl011_UART

# gpio
ifdef CONFIG_ENABLE_F_GPIO
	SRC_DIR += $(CUR_DIR)/drivers/gpio/f_gpio
	INC_DIR += $(CUR_DIR)/drivers/gpio/f_gpio
endif

# spi
ifdef CONFIG_ENABLE_FSPI
	SRC_DIR += $(CUR_DIR)/drivers/spi/f_spi
	INC_DIR += $(CUR_DIR)/drivers/spi/f_spi
endif

# iomux 
ifdef CONFIG_ENABLE_FIOMUX
	SRC_DIR += $(CUR_DIR)/drivers/iomux/f_iomux
	INC_DIR += $(CUR_DIR)/drivers/iomux/f_iomux
endif

# eth
ifdef CONFIG_ENABLE_F_XMAC
	SRC_DIR += $(CUR_DIR)/drivers/eth/f_xmac 
	INC_DIR += $(CUR_DIR)/drivers/eth/f_xmac 
endif

ifdef CONFIG_ENABLE_F_GMAC
	SRC_DIR += $(CUR_DIR)/drivers/eth/f_gmac \
				$(CUR_DIR)/drivers/eth/f_gmac/phy
	INC_DIR += $(CUR_DIR)/drivers/eth/f_gmac \
				$(CUR_DIR)/drivers/eth/f_gmac/phy

	ifdef CONFIG_F_GMAC_PHY_AR803X
		SRC_DIR += $(CUR_DIR)/drivers/eth/f_gmac/phy/ar803x
		INC_DIR += $(CUR_DIR)/drivers/eth/f_gmac/phy/ar803x
	endif
endif

# can
ifdef CONFIG_ENABLE_F_CAN
	SRC_DIR += $(CUR_DIR)/drivers/can/ft_can
	INC_DIR += $(CUR_DIR)/drivers/can/ft_can
endif

# pcie

ifdef CONFIG_ENABLE_F_PCIE
	SRC_DIR += $(CUR_DIR)/drivers/pcie/fpcie
	INC_DIR += $(CUR_DIR)/drivers/pcie/fpcie
endif

# i2c
ifdef CONFIG_USE_DW_I2C
	SRC_DIR += $(CUR_DIR)/drivers/i2c/dw_i2c
	INC_DIR += $(CUR_DIR)/drivers/i2c/dw_i2c	
endif

# sdmmc
ifdef CONFIG_USE_F_SDMMC
	SRC_DIR += $(CUR_DIR)/drivers/mmc/f_sdmmc
	INC_DIR += $(CUR_DIR)/drivers/mmc/f_sdmmc
endif

# sdio
ifdef CONFIG_USE_F_SDIO
	SRC_DIR += $(CUR_DIR)/drivers/mmc/f_sdio
	INC_DIR += $(CUR_DIR)/drivers/mmc/f_sdio
endif

#wdt
ifdef CONFIG_ENABLE_FWDT
	SRC_DIR += $(CUR_DIR)/drivers/watchdog/fwdt
	INC_DIR += $(CUR_DIR)/drivers/watchdog/fwdt
endif


# dma
ifdef CONFIG_ENABLE_F_GDMA 
	SRC_DIR += $(CUR_DIR)/drivers/dma/gdma
	INC_DIR += $(CUR_DIR)/drivers/dma/gdma
endif
